﻿@model PagedList.IPagedList<Model.goods>
@using PagedList.Mvc;

@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    ViewBag.Title = "商品下架";
}

<table class="table">
    <tr>
        <th>
            序号
        </th>
        <th>
            名称
        </th>
        <th>
            单价
        </th>
        <th>
            图片
        </th>
        <th>
            简介
        </th>
        <th>
            状态
        </th>
        <th>
            分类
        </th>
        <th>
            操作
        </th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.goodName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.goodprice)
            </td>
            <td>
                <img style="width:70px;" src="~/Content/images/@item.goodImage" alt="Alternate Text" />
            </td>
            <td>
                <span style=" display:inline-block;width: 230px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">@Html.DisplayFor(modelItem => item.goodDesc)</span>
            </td>
            <td>
                @if (item.nowState == 1)
                {
                    <span style="width:55px;display:inline-block;">正常</span>
                }
                else
                {
                    <span style="width:55px;display:inline-block;">已下架</span>
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.goodType.typeName)
            </td>
            <td>
                @Html.ActionLink("上架/下架", "underCarriage", new { id = item.ID })
            </td>
        </tr>
    }

</table>
@Html.PagedListPager(Model, page => Url.Action("GoodsManange", "Admin", new { page = page }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new PagedListRenderOptions { LinkToFirstPageFormat = "首页", LinkToLastPageFormat = "尾页", MaximumPageNumbersToDisplay = 5 }, new AjaxOptions { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "manager-wrapper" }))

@section css{
    <link href="~/Content/css/PagedList.css" rel="stylesheet" />
    <link href="~/Content/css/GoodsClassicationPatialView.css" rel="stylesheet" />
}